package controller.servlet.category;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.Category;
import controller.dao.Dao_Category;

public class DeleteCategory extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int codigo = Integer.parseInt(request.getParameter("cod"));
		Dao_Category daoe = new Dao_Category();
		Category c = daoe.list(codigo);
		c.setActive(0);
		daoe.delete(c);
		response.sendRedirect("/ShoppingCart.Com_V6/admin/category.ja");
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
